﻿using Microsoft.Extensions.Configuration;


namespace TomNet.Core.Options
{
    /// <summary>
    /// <see cref="IConfiguration"/>扩展方法
    /// </summary>
    public static class ConfigurationExtensions
    {
        /// <summary>
        /// 从<see cref="IConfiguration"/>创建<see cref="TomNetOptions"/>
        /// </summary>
        public static TomNetOptions GetTomNetOptions(this IConfiguration configuration)
        {
            TomNetOptions options = new TomNetOptions();
            new TomNetOptionsSetup(configuration).Configure(options);
            return options;
        }
    }
}
